Repository navigation
Fix url-shortener python deploy scripts on current Azure CLI - #151
Closed
lazarkanelov wants to merge 1 commit into
Closed
lazarkanelov wants to merge 1 commit into
lazarkanelov wants to merge 1 commit into
Conversation
- scripts/deploy.sh: use --database-name for 'az postgres flexible-server db create'; Azure CLI 2.82 rejects --name. - bicep/deploy.sh: keep only the JSON deployment outputs; Azure CLI prints a Bicep notice on stdout that broke jq parsing.
bryansan-local
approved these changes
Nov 10, 2026
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified in the deployment-script updates for current Azure CLI compatibility.
No open issues 🎉
What changed in this PR
Updates the Python URL shortener sample’s deployment scripts to handle current Azure CLI behavior.
Changes:
- Uses
--database-namewhen creating the PostgreSQL database. - Removes leading CLI notices from Bicep deployment output before parsing the JSON with
jq.
| File | Description |
|---|---|
samples/url-shortener/python/scripts/deploy.sh |
Replaces the unsupported database creation argument. |
samples/url-shortener/python/bicep/deploy.sh |
Filters stdout to retain JSON before extracting deployment outputs. |
Review effort: Balanced
Contributor
Author
|
Closing: this was based on a test with an outdated Azure CLI (2.82.0 from Homebrew). On current Azure CLI (2.91/2.92) the original scripts work unmodified, and the --database-name change breaks CI. Sorry for the noise. |
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Running the url-shortener/python sample against the latest
localstack/localstack-azureimage with Azure CLI 2.82.0 fails in two deploy scripts. Neither failure is an emulator issue.scripts/deploy.sh:az postgres flexible-server db create --nameis rejected (unrecognized arguments: --name clicks). Current Azure CLI only accepts--database-name. A failed run also leaves a PostgreSQL server whose generated password was never saved, so the next run exits with "admin password is unknown".bicep/deploy.sh: Azure CLI prints "Bicep CLI is already installed at ..." on stdout duringaz deployment group create. The script captures stdout and pipes it tojq, so parsing fails ("jq: parse error") and the script exits with "Web App Name or Function App Name is empty" even though the deployment succeeded.--only-show-errorsdoes not suppress the line.Fix
scripts/deploy.sh:--name->--database-name.bicep/deploy.sh: after the deployment succeeds, keep only the JSON (sed -n '/^{/,$p') before thejqcalls.Verification
Latest
localstack/localstack-azureimage, Azure CLI 2.82.0, Apple silicon. From a clean state each time:scripts/deploy.shthenscripts/validate.sh: all validation checks passed.bicep/deploy.shthenscripts/validate.sh: all validation checks passed.